home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / util / time / Mayland.lha / MaylandV1.0 / Rexx / MaylandDemo.Rexx < prev    next >
OS/2 REXX Batch file  |  1996-09-15  |  1KB  |  41 lines

  1. /*\ This is some examples on how to use the ARexx interface offered by Mayland
  2. \*/
  3.  
  4. Options Results
  5. Address 'MaylandRexx'
  6.  
  7. /* Add a command that'll `Dir Sys:', use the current time, and set it to each tuesday */
  8.  AddDays Tuesday Command '"Dir Sys:"'
  9.  Say 'Command added each tuesday at' Left(Time('n'),5)
  10.  
  11. /* Add an event to this date, but every month, this year! (at 18 o'clock) */
  12.  SecondsToDate
  13.  DATESTR = RESULT
  14.  PATTERN = Word(DATESTR,1) '0' Word(DATESTR,3) '18 00'
  15.  AddDate PATTERN Before 0 After 2*60 Message '"I will return in a month"'
  16.  Say 'Event added the 'Word(PATTERN,1)'th of each month (only this year !)'
  17.  
  18. /* Add an event in ten minutes */
  19.  SecondsToDate Date('I')*24*60*60 + Time('S') + (60*10) + 30
  20.  PATTERN = RESULT
  21.  AddDate PATTERN After 24*60 Message '"Så er der the!"' BePolite DeleteAfterUse
  22.  Say "You'll be reminded at" SubWord(PATTERN,4,2) "(in ten minutes!)"
  23.  
  24. /* Say the time'n'date (nicely!) */
  25.  SecondsToDate
  26.  DATESTR = RESULT
  27.  Say 'It is ' Word(DATESTR,1)'-'Word(DATESTR,2)'-'Right(Word(DATESTR,3),2) 'at' Word(DATESTR,4)':'Word(DATESTR,5)
  28.  
  29. /* Tell how many seconds since 1-1-78 */
  30.  DateToSeconds
  31.  Say RESULT 'seconds have passed since 1-1-78...'
  32.  
  33. /* The date in half a year */
  34.  RESULT = Date('E')
  35.  Parse Var RESULT DATE '/' MONTH '/' YEAR
  36.  DateToSeconds DATE MONTH+6 YEAR
  37.  SecondsToDate RESULT
  38.  Say 'In EXACTLY half a year, the date will be' SubWord(RESULT,1,3)
  39.  
  40. Exit
  41.